package com.tianji.learning.controller;


import com.tianji.learning.query.PointsBoardQuery;
import com.tianji.learning.service.IPointsBoardSeasonService;
import com.tianji.learning.service.IPointsBoardService;
import com.tianji.learning.vo.PointsBoardSeasonVO;
import com.tianji.learning.vo.PointsBoardVO;
import com.tianji.learning.vo.PointsStatisticsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2023-06-01
 */
@RestController
@RequestMapping("/board/seasons")
@Api("积分业务")
@RequiredArgsConstructor
public class PointsBoardSeasonController {

    private final IPointsBoardSeasonService boardSeasonService;

    @ApiOperation("查询所有赛季")
    @GetMapping("list")
    public List<PointsBoardSeasonVO> queryMyPointsBoardSeason(){
        return boardSeasonService.queryMyPointsBoardSeason();
    }

    private final IPointsBoardService pointsBoardService;

    @GetMapping
    @ApiOperation("分页查询指定赛季的积分排行榜")
    public PointsBoardVO queryPointsBoardBySeason(PointsBoardQuery query){
        return pointsBoardService.queryPointsBoardBySeason(query);
    }

}
